<!-- $Id: admin_logs.htm 15477 2008-12-22 03:44:50Z sunxiaodong $ -->

{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
<table>
    <tr>
      <td width="50%">
      <form name="theForm" method="POST" action="admin_logs.php">
      View by the IP 
      <select name="ip">
      <option value='0'>select ip</option>
      {html_options options=$ip_list selected=$ip}
      </select>
      <input type="submit" value="Search" class="button" />
      </form>
      </td>
      <td>
      <form name="Form2" action="admin_logs.php?act=batch_drop" method="POST">
      Clear Logs
      <select name="log_date">
        <option value='0'>select clear date}</option>
        <option value='1'>one week ago</option>
        <option value='2'>one month ago</option>
        <option value='3'>three months ago</option>
        <option value='4'>six months ago</option>
        <option value='5'>a yaer ago</option>
      </select>
      <input name="drop_type_date" type="submit" value="Clear" class="button" />
      </form>
      </td>
    </tr>
</table>
</div>

<form method="POST" action="admin_logs.php?act=batch_drop" name="listForm">
<!-- start admin_logs list -->
<div class="list-div" id="listDiv">
{/if}

<table cellpadding="3" cellspacing="1">
  <tr>
    <th><input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
    <a href="javascript:listTable.sort('log_id'); ">Log ID</a>{$sort_log_id}</th>
    <th><a href="javascript:listTable.sort('user_id'); ">Admin Name</a>{$sort_user_id}</th>
    <th><a href="javascript:listTable.sort('log_time'); ">Log Time</a>{$sort_log_time}</th>
    <th><a href="javascript:listTable.sort('ip_address'); ">IP Address</a>{$sort_ip_address}</th>
    <th>Log Info</th>
  </tr>
  {foreach from=$log_list item=list}
  <tr>
    <td width="10%"><span><input name="checkboxes[]" type="checkbox" value="{$list.log_id}" onclick="changeAction()"/>{$list.log_id}</span></td>
    <td width="15%" class="first-cell"><span>{$list.user_name|escape:html}</span></td>
    <td width="20%" align="center"><span>{$list.log_time}</span></td>
    <td width="15%" align="left"><span>{$list.ip_address}</span></td>
    <td width="40%" align="left"><span>{$list.log_info}</span></td>
  </tr>
  {/foreach}
  <tr>
    <td colspan="2"><input name="drop_type_id" type="submit" id="btnSubmit" value="{$lang.drop_logs}" disabled="true" class="button" /></td>
    <td align="right" nowrap="true" colspan="10">{include file="page.htm"}</td>
  </tr>
</table>

{if $full_page}
</div>
<!-- end ad_position list -->

<script type="text/javascript" language="JavaScript">
  listTable.recordCount = {$record_count};
  listTable.pageCount = {$page_count};

  {foreach from=$filter item=item key=key}
  listTable.filter.{$key} = '{$item}';
  {/foreach}
  {literal}
  onload = function()
  {
    // &#65533;&#65533;&#700;&#65533;&#65533;鹜&#65533;&#65533;
    startCheckOrder();
  }
  {/literal}
  
   function changeAction()
{
	
	var oCheckBox = document.getElementsByName('checkboxes[]');
	for(var i = 0; i < oCheckBox.length; i++)
	{
		if(oCheckBox[i].checked == true)
		{
			document.getElementById('btnSubmit').removeAttribute('disabled');
			return 0;
		}
	}
	document.getElementById('btnSubmit').setAttribute('disabled','disabled');
}
</script>
{include file="pagefooter.htm"}
{/if}
